Set environment variable for rustc in custom_build.rs
authorPanashe M. Fundira <fundirap@gmail.com>
Wed, 6 Jul 2016 01:36:09 +0000 (21:36 -0400)
committerPanashe M. Fundira <fundirap@gmail.com>
Wed, 6 Jul 2016 01:36:09 +0000 (21:36 -0400)
src/cargo/ops/cargo_rustc/custom_build.rs

index 8660a65ee7b72069808ec843b3870c32db6eb36d..c3b55e868471281de1ae7c5096f012562885c34a 100644 (file)
@@ -112,7 +112,8 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>)
      .env("DEBUG", &profile.debuginfo.to_string())
      .env("OPT_LEVEL", &profile.opt_level.to_string())
      .env("PROFILE", if cx.build_config.release {"release"} else {"debug"})
-     .env("HOST", &cx.config.rustc_info().host);
+     .env("HOST", &cx.config.rustc_info().host)
+     .env("RUSTC", &cx.config.rustc());
 
      if let Some(links) = unit.pkg.manifest().links(){
         p.env("CARGO_MANIFEST_LINKS", links);